package cn.edu.stu.syllabus.datas;

import android.app.Activity;
import android.support.annotation.DrawableRes;

import java.util.ArrayList;
import java.util.List;

import cn.edu.stu.syllabus.R;
import cn.edu.stu.syllabus.library.query.QueryBooksActivity;
import cn.edu.stu.syllabus.login.LoginActivity;
import cn.edu.stu.syllabus.oa.list.OaActivity;
import cn.edu.stu.syllabus.takeout.list.TakeOutActivity;

/**
 * Created by daidaijie on 2017/3/7.
 */

public class FunctionItem {

    private String mName;

    @DrawableRes
    private int mIcon;

    private Class<? extends Activity> mActivityClazz;

    public FunctionItem() {
    }

    public String getName() {
        return mName;
    }

    public FunctionItem setName(String name) {
        mName = name;
        return this;
    }

    public int getIcon() {
        return mIcon;
    }

    public FunctionItem setIcon(@DrawableRes int icon) {
        mIcon = icon;
        return this;
    }

    public Class<? extends Activity> getActivityClazz() {
        return mActivityClazz;
    }

    public FunctionItem setActivityClazz(Class<? extends Activity> activityClazz) {
        mActivityClazz = activityClazz;
        return this;
    }

    public static class FunctionItemsHolder {
        public static List<FunctionItem> mFunctionItems;
        public static FunctionItem mSyllabusFunctionItems;

        static {
            mFunctionItems = new ArrayList<>();
            mFunctionItems.add(new FunctionItem().setName("流量验证").setIcon(R.drawable.ic_wifi).setActivityClazz(LoginActivity.class));
            mFunctionItems.add(new FunctionItem().setName("办公自动化").setIcon(R.drawable.ic_oa).setActivityClazz(OaActivity.class));
            mFunctionItems.add(new FunctionItem().setName("流量验证").setIcon(R.drawable.ic_wifi));
            mFunctionItems.add(new FunctionItem().setName("流量验证").setIcon(R.drawable.ic_wifi));
            mFunctionItems.add(new FunctionItem().setName("流量验证").setIcon(R.drawable.ic_wifi));
            mFunctionItems.add(new FunctionItem().setName("流量验证").setIcon(R.drawable.ic_wifi));
            mFunctionItems.add(new FunctionItem().setName("图书检索").setIcon(R.drawable.ic_library).setActivityClazz(QueryBooksActivity.class));
            mFunctionItems.add(new FunctionItem().setName("流量验证").setIcon(R.drawable.ic_action_daynight));
            mFunctionItems.add(new FunctionItem().setName("校园外卖").setIcon(R.drawable.ic_take_out).setActivityClazz(TakeOutActivity.class));
            mSyllabusFunctionItems = new FunctionItem().setName("我的课表").setIcon(R.drawable.ic_syllabus);
        }

    }
}
